<%-- 
    Document   : consultar
    Created on : 03/11/2011, 12:53:47 PM
    Author     : ari
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <script type="text/javascript">  
        function errorserv() {  
            alert('Ha ocurrido un error con el servidor, se le dirigirá a la página inicial.');  
        }  
  
    </script>
    <%-- start web service invocation --%>
    <%
    try {
	services.AccionWebService_Service service = new services.AccionWebService_Service();
	services.AccionWebService port = service.getAccionWebServicePort();
	// TODO process result here
	java.util.List<java.lang.String> result = port.getEmpresas();
        %>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="estilo.css">
        <title>Bolsa de Valores</title>
    </head>
    <body>
        <div class="caja">
        <h3>Empresas:</h3>
        <%
        out.println("<ul>");
        for(java.lang.String emp : result) {
            out.println("<li><a href='infoEmp.jsp?emp="+emp+"'>"+emp+"</a></li>");
        }
	out.println("</ul>");
        %>
        <div><input type=button value="Atras" onclick="location.href='main.jsp'"></div>
        </div>
        <%
    } catch (Exception ex) {
        %>    
        <head>
            <meta HTTP-EQUIV="REFRESH" content="2; url=index.jsp">
                <title>Bolsa de Valores</title>
            </head>
            <body><hr/>
            <script>
            window.onload=errorserv;
            </script>
                
        <%
        %>
        </body>
        <%
	// TODO handle custom exceptions here
    }
    %>
    <%-- end web service invocation --%><hr/>
    </body>
</html>
